//
//  MeViewController.m
//  TingliFeng
//
//  Created by xinxuan on 16/1/11.
//  Copyright © 2016年 Bullgo. All rights reserved.
//

#import "MeViewController.h"
#import "TimeSetViewController.h"
#import "PDFExampleViewController.h"
#import "CustomAnimationDemoViewController.h"
#import "ZLSwipeableViewController.h"
#import "CollectionViewController.h"
#import "MTTouchIdTool.h"
#import "AboutUsViewController.h"
#import "UserAgreementViewController.h"
#import "ShoppingViewController.h"


@interface MeViewController ()



@property (weak, nonatomic) IBOutlet UISwitch *BlueTooth;


@property (weak, nonatomic) IBOutlet UIView *background;


- (IBAction)Message:(id)sender;


- (IBAction)BlueTooth:(id)sender;

- (IBAction)shopping:(id)sender;

- (IBAction)remind:(id)sender;
- (IBAction)aboutUs:(id)sender;
- (IBAction)collection:(id)sender;
- (IBAction)Useragreement:(id)sender;

@end

@implementation MeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.

}

-(void)viewWillAppear:(BOOL)animated{
    
    [[NSNotificationCenter defaultCenter]postNotificationName:@"supportedInterfaceOrientations" object:self userInfo:@{@"surport" : [NSNumber numberWithBool:NO]}];
    
}







- (IBAction)Message:(id)sender {
  
    ZLSwipeableViewController * pdfView = [[ZLSwipeableViewController alloc]init];
    [self.navigationController pushViewController:pdfView animated:YES];
    
}








- (IBAction)BlueTooth:(id)sender {
    UISwitch * mySwitch = (UISwitch*)sender;
    if (mySwitch.isOn) {
        NSLog(@"蓝牙开关开启");
        [self openBlueTooth];

        
    }else{
        NSLog(@"蓝牙关闭开关");
        [self openBlueTooth];
    }
}




-(void)openBlueTooth{
    
    NSURL *url = [NSURL URLWithString:@"prefs:root=Bluetooth"];
    if ([[UIApplication sharedApplication] canOpenURL:url])
    {
        [[UIApplication sharedApplication] openURL:url];
        
    }
    
}


- (IBAction)shopping:(id)sender {
    NSLog(@"购物");
    ShoppingViewController * remindVC = [[ShoppingViewController alloc]init];
    [self.navigationController pushViewController:remindVC animated:YES];

    
}

- (IBAction)remind:(id)sender {
  
    
    
    TimeSetViewController * remindVC = [[TimeSetViewController alloc]init];
    [self.navigationController pushViewController:remindVC animated:YES];
    
    
    
}

- (IBAction)aboutUs:(id)sender {
    NSLog(@"关于我们");
    AboutUsViewController * remindVC = [[AboutUsViewController alloc]init];
    [self.navigationController pushViewController:remindVC animated:YES];
}

- (IBAction)collection:(id)sender {
    NSLog(@"收藏");
    CollectionViewController * collectionVC = [[CollectionViewController alloc]init];
    [self.navigationController pushViewController:collectionVC animated:YES];
}

- (IBAction)Useragreement:(id)sender {
    NSLog(@"用户信息");
    UserAgreementViewController * remindVC = [[UserAgreementViewController alloc]init];
    [self.navigationController pushViewController:remindVC animated:YES];
}




@end
